﻿using IdentityServer4;
using IdentityServer4.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace User.Identity
{
    public class Config
    {
        public static IEnumerable<Client> GetClients() => new List<Client>()
        {
            new Client(){
                 ClientId="finbook_android",
                 ClientSecrets={ new Secret("p@ssw0rd".Sha256())},
                 //AllowedGrantTypes={ GrantType.ResourceOwnerPassword},
                       AllowedGrantTypes=GrantTypes.ResourceOwnerPassword,
                 AllowedScopes={ "user_api",IdentityServerConstants.StandardScopes.Profile, IdentityServerConstants.StandardScopes.OpenId}
            }
        };

        public static IEnumerable<ApiResource> GetApiResources() => new List<ApiResource>()
        {
            new ApiResource("user_api","user api service")
        };
        public static IEnumerable<IdentityResource> GetIdentityResources() => new List<IdentityResource>()
        {
            new IdentityResources.OpenId(),
            new IdentityResources.Profile()
        };
    }
}
